//
//  AssessCell.m
//  WE
//
//  Created by iMacOne on 15/11/24.
//  Copyright © 2015年 UNOHACHA. All rights reserved.
//

#import "AssessCell.h"
#import "Size.h"
#import "ToolUtil.h"
@interface AssessCell ()
@property (nonatomic, strong)UISegmentedControl * segmentControl;

@end

@implementation AssessCell

- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}
- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        
        self.segmentControl  = [[UISegmentedControl alloc] initWithItems:@[@"就医推荐",@"健康咨询",@"很标准",@"太胖"]];
        _segmentControl.frame = CGRectMake(margin_15 * Width, 5 * Height, WindowWidth - margin_30 * Width*2, 27);
        _segmentControl.selectedSegmentIndex = 0;
        [_segmentControl setTintColor:[UIColor redColor]];
        [_segmentControl addTarget:self action:@selector(doClick:) forControlEvents:UIControlEventValueChanged];
        [self.contentView addSubview:_segmentControl];
        [ToolUtil createLine:39 superView:self.contentView lift:0 width:WindowWidth hight:1 color:GRAYCOLOR];
    }
    return self;
}
- (void)doClick:(UISegmentedControl *)segment
{
    [self.delegate doClickBtn:segment.selectedSegmentIndex cell:self];
    
}


@end
